# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=quota-tools
pkgver=4.06
pkgrel=1
epoch=1
pkgdesc="Tools to manage kernel-level quotas in Linux"
arch=(x86_64)
url="https://sourceforge.net/projects/linuxquota/"
license=(GPL BSD)
depends=(libnl dbus libtirpc)
makedepends=(rpcsvc-proto)
backup=('etc/warnquota.conf' 'etc/quotatab' 'etc/quotagrpadmins')
source=(https://downloads.sourceforge.net/sourceforge/linuxquota/quota-$pkgver.tar.gz)
sha1sums=('98288699cc14da42f762301c2b6731ec7c777681')

build() {
  cd quota-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc
  make
}

package() {
  cd quota-$pkgver
  make DESTDIR="$pkgdir" sbindir=/usr/bin root_sbindir=/usr/bin STRIP="" install
  install -d "$pkgdir/usr/share/licenses/$pkgname"
  head -33 quota.c > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

# remove conflicts with glibc
  rm -r "$pkgdir"/usr/include
}
